home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / tcvbnettoolbridge.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2004-07-15  |  1.5 KB  |  50 lines

  1. //******************************************************************'
  2. //*                                                                *'
  3. //*                      TurboCAD for Windows                      *'
  4. //*                   Copyright (c) 1993 - 2004                    *'
  5. //*             International Microcomputer Software, Inc.         *'
  6. //*                            (IMSI)                              *'
  7. //*                      All rights reserved.                      *'
  8. //*                                                                *'
  9. //******************************************************************'
  10. // TCVBNETToolBridge.cpp : Defines the entry point for the DLL application.
  11. //
  12.  
  13. #include "stdafx.h"
  14.  
  15. BOOL APIENTRY DllMain( HANDLE hModule, 
  16.                        DWORD  ul_reason_for_call, 
  17.                        LPVOID lpReserved
  18.                      )
  19. {
  20.     return TRUE;
  21. }
  22.  
  23. // This is an example of an exported variable
  24. STDAPI DllRegisterServer(void)
  25. {
  26.     // registers object, typelib and all interfaces in typelib
  27.     return S_OK;
  28. }
  29.  
  30. long _stdcall GetServerProgIDs(VARIANT* pvarIDs)
  31. {
  32.     long nCnt = 1;
  33.     long nIndicies = 0;
  34.  
  35.     CComBSTR bstrProgID(_T("TCVBNETTool.VBNetTCTool"));
  36.     BSTR bstr = bstrProgID.Detach();
  37.  
  38.     SAFEARRAY* psa = SafeArrayCreateVector(VT_BSTR, 0, nCnt);
  39.     
  40.     HRESULT hr = SafeArrayPutElement(psa, &nIndicies, bstr);
  41.     _ASSERTE(SUCCEEDED(hr));
  42.  
  43.     bstrProgID.Detach();
  44.  
  45.     pvarIDs->vt = VT_ARRAY | VT_BSTR;
  46.     pvarIDs->parray = psa;
  47.  
  48.     return nCnt;
  49. }
  50.